home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / share / Dos / VARIOS / pascal / EGAVGA.SWG / 0001_BASM Display String with font.pas next >
Encoding:
Pascal/Delphi Source File  |  1996-02-21  |  1.6 KB  |  41 lines

  1.  
  2. {$G+}
  3. const
  4.   screen=ptr($A000,0);
  5.   font=ptr($F0A0,$F06E);
  6.  
  7. Function ReadKey:Char;Assembler;
  8. Asm
  9.   mov ah,00h;       int 16h
  10. End;
  11.  
  12. Procedure DispStr(x,y:Word;color:Byte;page,font:Pointer;s:String);Assembler;
  13. Asm
  14.   les di,s;         mov al,es:[di];    push ax;           push es;
  15.   push di;          @begin:;           les di,s;          mov al,es:[di];
  16.   cmp al,0;         je @exit;          dec al;            mov es:[di],al;
  17.   inc al;           xor ah,ah;         mov dx,ax;         add di,ax;
  18.   mov al,es:[di];   shl ax,3;          les di,font;       add di,ax;
  19.   mov bx,di;        mov cx,es;         les di,page;       mov ax,y;
  20.   mov dh,al;        shl ax,6;          add ah,dh;         xor dh,dh;
  21.   shl dx,3;         add ax,dx;         add ax,x;          add di,ax;
  22.   mov ah,color;     xchg di,bx;        mov si,es;         mov es,cx;
  23.   mov cx,si;        mov dx,0880h;      @loop1:;           mov al,es:[di];
  24.   xchg di,bx;       mov si,es;         mov es,cx;         mov cx,si;
  25.   @loop2:;          cmp al,dl;         jb @loop3;         sub al,dl;
  26.   mov es:[di],ah;   @loop3:;           inc di;            cmp dl,0;
  27.   shr dl,1;         jne @loop2;        mov dl,80h;        add di,312;
  28.   xchg di,bx;       mov si,es;         mov es,cx;         mov cx,si;
  29.   inc di;           dec dh;            cmp dh,0;          jne @loop1;
  30.   jmp @begin;       @exit:;            pop di;            pop es;
  31.   pop ax;           mov es:[di],al;
  32. End;
  33.  
  34. begin
  35.   asm; mov ax,13h; int 10h; end;
  36.   dispstr(10,10,15,screen,font,'does it work?');
  37.   readkey;
  38.   asm; mov ax,03h; int 10h; end;
  39. end.
  40.  
  41.